package com.ruoyi.common.utils;

/**
 * @Author: LiJunXi
 * @Description:
 * @Date: 2024-11-12  19:02
 */
public class FileUtil {


    public static String getFileExtension(String fileName) {
        int lastIndexOfDot = fileName.lastIndexOf(".");
        if (lastIndexOfDot == -1) {
            // 如果文件名没有扩展名，返回空字符串
            return "";
        }
        return fileName.substring(lastIndexOfDot + 1);
    }

}
